#include <cstring>
#include <iostream>
#include <iterator>
#include <ostream>
#include <string.h>

using namespace std;

class String {
public:
  String();
  String(const char *str);
  ~String();
  char &operator[](int i);
  int Size();
  friend ostream &operator<<(ostream &output, const String &obj);
  friend istream &operator>>(istream &input, const String &obj);

private:
  char *str;
  int size;
};

String::String() {
  this->size = 10;
  this->str = new char[this->size];
}

String::String(const char *str) {
  this->size = strlen(str);
  this->str = new char[this->size + 1];
  strcpy(this->str, str);
  this->str[this->size] = '\0';
};
String::~String() { delete[] this->str; }

int String::Size() {
  this->size = strlen(this->str);
  return this->size;
};

char &String::operator[](int i) {
  if (i > size - 1 || i < 0) {
    return this->str[0];
  }

  return this->str[i];
}

istream &operator>>(istream &input, const String &obj) {
  if (obj.str != nullptr) {
    return input >> obj.str;
  }

  return input;
}

ostream &operator<<(ostream &output, const String &obj) {
  if (obj.str != nullptr) {
    return output << obj.str;
  }
  return output;
}

int main() {

  String str;
  cin >> str;

  for (int i = 0; i < str.Size(); i++) {
    cout << str[i] << endl;
  }
  cout << str << endl;

  return 0;
}